/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SECURE_ELEMENT_CHANNEL_H
#define SECURE_ELEMENT_CHANNEL_H
#include "cj_common_ffi.h"
#include "native/ffi_remote_data.h"
#include "channel.h"
#include "secure_element_ffi.h"
#include "secure_element_session.h"

namespace OHOS {
namespace SE {
namespace OMAPI {
class SEChannelImpl : public OHOS::FFI::FFIData {
    DECL_TYPE(SEChannelImpl, OHOS::FFI::FFIData)
public:
    SEChannelImpl() = default;
    ~SEChannelImpl() = default;

    void SetChannel(std::shared_ptr<Channel> channel);

    void SetSession(SESessionImpl *se);

    int64_t GetSession(int32_t *errorCode);

    void Close(int32_t *errorCode);

    bool IsClosed(int32_t *errorCode);

    bool IsBasicChannel(int32_t *errorCode);

    std::string GetSelectResponse(int32_t *errorCode);

    std::string Transmit(const std::string &command, int32_t *errorCode);

private:
    std::shared_ptr<Channel> channel_{};
    SESessionImpl *session_{};
};
}  // namespace OMAPI
}  // namespace SE
}  // namespace OHOS
#endif
